import requests

import requests

url = 'http://www.tipdm.com/tipdm/index.html'  # 生成get请求
url = "http://127.0.0.1:8000/user/useragent/"

"""自己写的这个东西--user_agent PC / Windows 10 / Edge 119.0.0
[05/Dec/2023 13:46:55] "GET /user/useragent/ HTTP/1.1" 200 47
自己写的这个东西--user_agent PC / Windows 10 / Edge 119.0.0
[05/Dec/2023 13:47:02] "GET /user/useragent/ HTTP/1.1" 200 47
自己写的这个东西--user_agent Other / Other / Python Requests 2.18
[05/Dec/2023 13:48:03] "GET /user/useragent/ HTTP/1.1" 200 47"""
headers = {
    "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.139 Safari/537.36",

    'Cookie': 'i am cookies'

}
params = {"key": "鼠标"}
#  /user/useragent/? key=%E9%BC%A0%E6%A0%87    会在请求后面加上这个东西

# rqg = requests.get(url, headers=headers, params=params, timeout=3)
rqg = requests.get(url)

# 查看结果类型
print('查看结果类型：', type(rqg))
# 查看状态码
print('状态码：', rqg.status_code)
# 查看编码
print('编码 ：', rqg.encoding)
# 查看响应头
print('响应头：', rqg.headers)
# 打印查看网页内容
print('查看网页内容：', rqg.text)
